home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Programming Contest / Secret Solutions Folder / Problem 03 - Perimeter / Solution.cp < prev    next >
Encoding:
Text File  |  1998-06-08  |  1010 b   |  37 lines  |  [TEXT/CWIE]

  1. /*
  2. Problem 12 - Perimeter
  3.  
  4. You are in charge of protecting a set of defenseless homeowners from predators that roam the area by constructing a fence of minimum length that encloses all of the homes.  
  5.  
  6. The prototype for your solution is as follows:
  7.  
  8. typedef struct Node {
  9.     SInt32 xCoord;
  10.     SInt32 yCoord;
  11. } Node;
  12.  
  13. void Perimeter(
  14.     UInt32 numHomes,
  15.     Node homesToEnclose[],
  16.     UInt32 *numNodesInPerimeter,
  17.     UInt32 nodesInPerimeter[]
  18. );
  19.  
  20. You are given a list homesToEnclose of numHomes homes to protect by constructing a fence around the homes. You should return a list nodesInPerimeter of the numNodesInPerimeter homes to be connected by a fence.  The fence must enclose all of the homes using the minimum amount of fencing material.
  21. */
  22.  
  23. #include "Solution.h"
  24.  
  25. // Fill in your solution and then submit this folder
  26.  
  27. // Team Name: FILL IN YOUR TEAM NAME!
  28.  
  29. pascal void Perimeter(
  30.     UInt32 numHomes,
  31.     const Node homesToEnclose[],
  32.     UInt32 *numNodesInPerimeter,
  33.     UInt32 nodesInPerimeter[]
  34. ) {
  35.     *numNodesInPerimeter = 0;
  36. }
  37.